checkLogin()
renderUsername()
registerLoginOut()

//首页 统计数据
async function getData(){
    const token = localStorage.getItem('token')
    //调用接口
    const res =await axios({
        url:"/dashboard",
        headers:{
            Authorization:token
        }
    })
    console.log(res.data.overview)
    const overview =res.data.data.overview
  //渲染数据
  Object.keys(overview).forEach(key =>{
    document.querySelector(`.${key}`).innerHTML = overview[key]
  })  
}
getData()